package com.lanou.sfu.songforu.db;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lanou.sfu.songforu.db.SongListEntity;
import com.lanou.sfu.songforu.db.BillboardEntity;

import com.lanou.sfu.songforu.db.SongListEntityDao;
import com.lanou.sfu.songforu.db.BillboardEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig songListEntityDaoConfig;
    private final DaoConfig billboardEntityDaoConfig;

    private final SongListEntityDao songListEntityDao;
    private final BillboardEntityDao billboardEntityDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        songListEntityDaoConfig = daoConfigMap.get(SongListEntityDao.class).clone();
        songListEntityDaoConfig.initIdentityScope(type);

        billboardEntityDaoConfig = daoConfigMap.get(BillboardEntityDao.class).clone();
        billboardEntityDaoConfig.initIdentityScope(type);

        songListEntityDao = new SongListEntityDao(songListEntityDaoConfig, this);
        billboardEntityDao = new BillboardEntityDao(billboardEntityDaoConfig, this);

        registerDao(SongListEntity.class, songListEntityDao);
        registerDao(BillboardEntity.class, billboardEntityDao);
    }
    
    public void clear() {
        songListEntityDaoConfig.getIdentityScope().clear();
        billboardEntityDaoConfig.getIdentityScope().clear();
    }

    public SongListEntityDao getSongListEntityDao() {
        return songListEntityDao;
    }

    public BillboardEntityDao getBillboardEntityDao() {
        return billboardEntityDao;
    }

}
